package com.cuiyun97.service.impl;

import com.cuiyun97.domain.po.SetJwt;
import com.cuiyun97.domain.po.SetOss;
import com.cuiyun97.domain.po.SetSms;
import com.cuiyun97.mapper.SetJwtMapper;
import com.cuiyun97.mapper.SetOssMapper;
import com.cuiyun97.mapper.SetSmsMapper;
import com.cuiyun97.service.SettingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SettingServiceImpl implements SettingService {

    @Resource
    private SetOssMapper setOssMapper;

    @Resource
    private SetSmsMapper setSmsMapper;

    @Resource
    private SetJwtMapper setJwtMapper;

    @Override
    public SetSms querySms() {
        return setSmsMapper.getLastOne();
    }

    @Override
    public void updateSms(SetSms lastOne) {
        setSmsMapper.updateLastOne(lastOne);
    }

    @Override
    public SetOss queryOss() {
        return setOssMapper.getLastOne();
    }

    @Override
    public void updateOss(SetOss lastOne) {
        setOssMapper.updateLastOne(lastOne);
    }

    @Override
    public SetJwt queryJwt() {
        return setJwtMapper.getLastOne();
    }

    @Override
    public void updateJwt(SetJwt lastOne) {
        setJwtMapper.updateLastOne(lastOne);
    }
}
